package service;

import entity.License;
import entity.User;
import entity.UserAddress;

import java.util.ArrayList;

import dao.Admin_UserDAO;

public class User_Acount_Service {
    Admin_UserDAO uai = new Admin_UserDAO();//初始化User_Acoutn_Impl
    /**
     * 判断是否登陆成功
     * @param tua
     * @return
     */
    public boolean adminLogin(User tua){
//        String pwdMd5  = md5.towMd5(tua.getPassword());//将获取的用户输入的登录账号加密
        return uai.admin_login(tua.getLoginId(),tua.getPassword());//将加密过的串拿去数据库比对
    }

    /**
     * 显示所有商家信息
     * @return
     */
    public ArrayList<User> shopShow(){
        return uai.show_shop();
    }

    /**
     * 对商户进行封禁解封处理
     * @param shopId
     * @param butVal
     * @return
     */
    public int shopOperation(String shopId,String butVal){
        return uai.shop_operation(shopId,butVal);
    }

    /**
     * 展示成为商家的申请
     * @param shopType
     * @return
     */
    public ArrayList<User> show_shopType(String shopType) {
        return uai.show_shopType(shopType);
    }

    public License shopApply(String shopId){
        return uai.shop_apply(shopId);
    }

    public int apply_yesOrNo(String yes_no,int userId){
        return uai.apply_yesOrNo(userId, yes_no);
    }
}
